from robot_command.resolve_command import resolve_command


class RunCommand:

    def __init__(self):
        self.__command_dict = {
            # 骰子
            'rd': 'dice_service',
            'shutdown': 'bot_shutdown',
            'wakeUp': 'bot_startUp',
            'stp': 'sir_two_plz',
            # 生活指数
            'li': 'life_index',
            'blog': 'blog_search'
        }

    def get_service_func(self, command: str):
        command_dict = resolve_command(command)
        command_name = command_dict.get('command_name', '')
        command_func_name = self.__command_dict.get(command_name, '')
        if command_func_name == '':
            return
        command_func_param = command_dict.get('command_param', '')

        return {'command_func_name': command_func_name,
                'command_func_param': command_func_param}


